package cn.dzz.service;

import cn.dzz.dao.UserDao;
import cn.dzz.entity.User;
import cn.dzz.util.TransactionManager;

import java.sql.SQLException;

/**
 * @author ArkD42
 * @file OA
 * @create 2020 - 06 - 17 - 23:25
 */
public class UserServiceImpl implements UserService{

    UserDao userDao;

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    public UserServiceImpl(UserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public void changeUser(User user) throws SQLException {
            int i = userDao.updateUserById(user);
            user.setU_id(4);
            int error = 1/0;
            int i2 = userDao.updateUserById(user);
            System.out.println("userDao的更新结果：" + i + i2);
    }
}
